.TH "servo_dec.c" 3 "Wed Sep 16 2015" "Doxygen" \" -*- nroff -*-
.ad l
.nh
.SH NAME
servo_dec.c \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'servo_dec\&.h'\fP
.br
\fC#include 'stm32f4xx_conf\&.h'\fP
.br
\fC#include 'ch\&.h'\fP
.br
\fC#include 'hal\&.h'\fP
.br
\fC#include 'hw\&.h'\fP
.br
\fC#include 'utils\&.h'\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBSERVO_NUM\fP   1"
.br
.ti -1c
.RI "#define \fBTIMER_FREQ\fP   1000000"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBservodec_init\fP (void(*d_func)(void))"
.br
.ti -1c
.RI "void \fBservodec_set_pulse_options\fP (float start, float end, bool median_filter)"
.br
.ti -1c
.RI "float \fBservodec_get_servo\fP (int servo_num)"
.br
.ti -1c
.RI "uint32_t \fBservodec_get_time_since_update\fP (void)"
.br
.ti -1c
.RI "float \fBservodec_get_last_pulse_len\fP (int servo_num)"
.br
.in -1c
.SH "Macro Definition Documentation"
.PP 
.SS "#define SERVO_NUM   1"

.SS "#define TIMER_FREQ   1000000"

.SH "Function Documentation"
.PP 
.SS "float servodec_get_last_pulse_len (int servo_num)"
Get the length of the last received pulse\&.
.PP
\fBParameters:\fP
.RS 4
\fIservo_num\fP The servo index\&. If it is out of range, 0\&.0 will be returned\&.
.RE
.PP
\fBReturns:\fP
.RS 4
The length of the last received pulse\&. 
.RE
.PP

.SS "float servodec_get_servo (int servo_num)"
Get a decoded servo value\&.
.PP
\fBParameters:\fP
.RS 4
\fIservo_num\fP The servo index\&. If it is out of range, 0\&.0 will be returned\&.
.RE
.PP
\fBReturns:\fP
.RS 4
The servo value in the range [-1\&.0 1\&.0]\&. 
.RE
.PP

.SS "uint32_t servodec_get_time_since_update (void)"
Get the amount of milliseconds that has passed since the last time servo positions were received\&.
.PP
\fBReturns:\fP
.RS 4
The amount of milliseconds that have passed since an update\&. 
.RE
.PP

.SS "void servodec_init (void(*)(void) d_func)"
Initialize the serve decoding driver\&.
.PP
\fBParameters:\fP
.RS 4
\fId_func\fP A function that should be called every time the servo signals have been decoded\&. Can be NULL\&. 
.RE
.PP

.SS "void servodec_set_pulse_options (float start, float end, bool median_filter)"
Change the limits of how the servo pulses should be decoded\&.
.PP
\fBParameters:\fP
.RS 4
\fIstart\fP The amount of milliseconds the pulse starts at (default is 1\&.0)
.br
\fIend\fP he amount of milliseconds the pulse ends at (default is 2\&.0) 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen from the source code\&.
